﻿using System;
using System.Windows.Media;
using NetBay.Core.BusinessEntities.Workflow;

namespace Rio.Framework.Pages.AppCode.Helpers
{
    public static class WorkflowStateToColorHelper
    {



        public static void Initialize()
        {
        
        }


        /// <summary>
        /// Gets the color of the state.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <returns></returns>
        public static SolidColorBrush GetStateColor(WorkflowState state)
        {
            switch (state)
            {
                case WorkflowState.Started:
                case WorkflowState.None:
                case WorkflowState.Running:
                case WorkflowState.Faulted:
                case WorkflowState.Transfered:
                case WorkflowState.Indexed:
                case WorkflowState.Finished:
                case WorkflowState.Replied:
                case WorkflowState.Enveloping:
                case WorkflowState.Read:
                case WorkflowState.Validated:
                    return new SolidColorBrush(Colors.Black);
                case WorkflowState.Rejected:
                case WorkflowState.Aborted:
                    return new SolidColorBrush(Colors.Red);
                default:
                    return new SolidColorBrush(Colors.Black);
            }
        }

    }
}
